using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._GeodatabaseAdministration
{
    /// <summary>
    /// <para>Configure Geodatabase Log File Tables</para>
    /// <para>Alters the type of log file tables used by an enterprise geodatabase to maintain lists of records cached by ArcGIS.</para>
    /// <para>更改企业级地理数据库用于维护 ArcGIS 缓存的记录列表的日志文件表的类型。</para>
    /// </summary>    
    [DisplayName("Configure Geodatabase Log File Tables")]
    public class ConfigureGeodatabaseLogFileTables : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ConfigureGeodatabaseLogFileTables()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_database">
        /// <para>Input Database Connection</para>
        /// <para>A database connection (.sde file) to the enterprise geodatabase where the log file table configuration will be changed. The connection must be made as the geodatabase administrator.</para>
        /// <para>与企业级地理数据库的数据库连接（.sde 文件），其中日志文件表配置将被更改。必须以地理数据库管理员身份建立连接。</para>
        /// </param>
        /// <param name="_log_file_type">
        /// <para>Log File Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of log file tables the geodatabase will use.</para>
        ///   <bulletList>
        ///     <bullet_item>Session log file—Session-based log file tables for selection sets will be used. Session-based log file tables are dedicated to a single session and may contain multiple selection sets.</bullet_item><para/>
        ///     <bullet_item>Shared log file—Shared log file tables for selection sets will be used. Shared log file tables are shared by all sessions that connect as the same user.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定地理数据库将使用的日志文件表的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>会话日志文件—将使用基于会话的选择集日志文件表。基于会话的日志文件表专用于单个会话，并且可能包含多个选择集。</bullet_item><para/>
        ///     <bullet_item>共享日志文件—将使用选择集的共享日志文件表。共享日志文件表由以同一用户身份连接的所有会话共享。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public ConfigureGeodatabaseLogFileTables(object _input_database, _log_file_type_value _log_file_type)
        {
            this._input_database = _input_database;
            this._log_file_type = _log_file_type;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Configure Geodatabase Log File Tables";

        public override string CallName => "management.ConfigureGeodatabaseLogFileTables";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_input_database, _log_file_type.GetGPValue(), _log_file_pool_size, _use_tempdb.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Database Connection</para>
        /// <para>A database connection (.sde file) to the enterprise geodatabase where the log file table configuration will be changed. The connection must be made as the geodatabase administrator.</para>
        /// <para>与企业级地理数据库的数据库连接（.sde 文件），其中日志文件表配置将被更改。必须以地理数据库管理员身份建立连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Connection")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_database { get; set; }


        /// <summary>
        /// <para>Log File Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of log file tables the geodatabase will use.</para>
        ///   <bulletList>
        ///     <bullet_item>Session log file—Session-based log file tables for selection sets will be used. Session-based log file tables are dedicated to a single session and may contain multiple selection sets.</bullet_item><para/>
        ///     <bullet_item>Shared log file—Shared log file tables for selection sets will be used. Shared log file tables are shared by all sessions that connect as the same user.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定地理数据库将使用的日志文件表的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>会话日志文件—将使用基于会话的选择集日志文件表。基于会话的日志文件表专用于单个会话，并且可能包含多个选择集。</bullet_item><para/>
        ///     <bullet_item>共享日志文件—将使用选择集的共享日志文件表。共享日志文件表由以同一用户身份连接的所有会话共享。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Log File Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _log_file_type_value _log_file_type { get; set; }

        public enum _log_file_type_value
        {
            /// <summary>
            /// <para>Session log file</para>
            /// <para>Session log file—Session-based log file tables for selection sets will be used. Session-based log file tables are dedicated to a single session and may contain multiple selection sets.</para>
            /// <para>会话日志文件—将使用基于会话的选择集日志文件表。基于会话的日志文件表专用于单个会话，并且可能包含多个选择集。</para>
            /// </summary>
            [Description("Session log file")]
            [GPEnumValue("SESSION_LOG_FILE")]
            _SESSION_LOG_FILE,

            /// <summary>
            /// <para>Shared log file</para>
            /// <para>Shared log file—Shared log file tables for selection sets will be used. Shared log file tables are shared by all sessions that connect as the same user.</para>
            /// <para>共享日志文件—将使用选择集的共享日志文件表。共享日志文件表由以同一用户身份连接的所有会话共享。</para>
            /// </summary>
            [Description("Shared log file")]
            [GPEnumValue("SHARED_LOG_FILE")]
            _SHARED_LOG_FILE,

        }

        /// <summary>
        /// <para>Number of pooled session-based log file tables to be owned by the administrator</para>
        /// <para>The number of tables included in the pool that the geodatabase will use if a pool of session-based log file tables owned by the geodatabase administrator is used.</para>
        /// <para>如果使用地理数据库管理员拥有的基于会话的日志文件表池，则地理数据库将使用的池中包含的表数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of pooled session-based log file tables to be owned by the administrator")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _log_file_pool_size { get; set; } = null;


        /// <summary>
        /// <para>Create session-based log file tables in the TempDB database (Microsoft SQL Server only)</para>
        /// <para>This parameter is no longer applicable, starting with the ArcGIS 10.5 and ArcGIS Pro 1.4 releases.</para>
        /// <para>从 ArcGIS 10.5 和 ArcGIS Pro 1.4 版本开始，此参数不再适用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create session-based log file tables in the TempDB database (Microsoft SQL Server only)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _use_tempdb_value _use_tempdb { get; set; } = _use_tempdb_value._false;

        public enum _use_tempdb_value
        {
            /// <summary>
            /// <para>USE_TEMBDB</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_TEMBDB")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_USE_TEMBDB</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_USE_TEMBDB")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public ConfigureGeodatabaseLogFileTables SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}